Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generation missing newline #2582

Merged
merged 3 commits into from
Sep 13, 2023
Merged

Code generation missing newline #2582

merged 3 commits into from
Sep 13, 2023

Conversation

evan-schott
Copy link
Contributor

I noticed that newlines aren't appended in the code generation pass for simple function calls (Ex: BHP, Poseidon). This leads to inconsistent display of AVM bytecode. For example compiling

program helloworld.aleo {
  transition main(public a: u32, b: u32) -> u128 {
      let result: u128 = Poseidon2::hash_to_u128(1field);
      let result2: u128 = Poseidon2::hash_to_u128(22field);
      let result3: u128 = BHP256::hash_to_u128(1u128);
      return result + result2 + result3;
  }
}

yields:

program helloworld.aleo;



function main:
    input r0 as u32.public;
    input r1 as u32.private;
    hash.psd2 1field into r2 as u128;    hash.psd2 22field into r3 as u128;    hash.bhp256 1u128 into r4 as u128;    add r2 r3 into r5;
    add r5 r4 into r6;
    output r6 as u128.private;

@evan-schott evan-schott requested a review from d0cd September 11, 2023 21:48
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #2582 (054966f) into testnet3 (d70272a) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##           testnet3    #2582   +/-   ##
=========================================
  Coverage     79.95%   79.95%           
=========================================
  Files           160      160           
  Lines          5384     5384           
  Branches       5384     5384           
=========================================
  Hits           4305     4305           
  Misses         1079     1079           
Files Changed Coverage Δ
...er/passes/src/code_generation/visit_expressions.rs 78.06% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@d0cd d0cd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@d0cd d0cd merged commit 94e70eb into testnet3 Sep 13, 2023
8 checks passed
@d0cd d0cd deleted the bug/missing-newline branch September 13, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants